From 4b8134b19b7430b37093d2361d94313137ba0388 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 30 Oct 2020 14:57:58 -0400 Subject: [PATCH] constraintlayout: Emit less change notification This isn't strictly required for correctness, but it makes the GtkBuilder codepath do the same that the vfl codepath does: call gtk_layout_manager_layout_changed only once, after all the constraints have been added. --- gtk/gtkconstraintlayout.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/gtkconstraintlayout.c b/gtk/gtkconstraintlayout.c index 20027b480c..86ae56ce06 100644 --- a/gtk/gtkconstraintlayout.c +++ b/gtk/gtkconstraintlayout.c @@ -1696,9 +1696,14 @@ gtk_constraint_layout_custom_finished (GtkBuildable *buildable, continue; } - gtk_constraint_layout_add_constraint (data->layout, c); + layout_add_constraint (data->layout, c); + g_hash_table_add (data->layout->constraints, c); + if (data->layout->constraints_observer) + g_list_store_append (data->layout->constraints_observer, c); } + gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (data->layout)); + g_list_free_full (data->constraints, constraint_data_free); g_list_free_full (data->guides, guide_data_free); g_object_unref (data->layout); -- 2.30.2